CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT (LIBUUIDX)
SET(LIBUUIDX_SRC uuid.c)
ADD_DEFINITIONS(-g -Wall)

INCLUDE_DIRECTORIES(/usr/local/include)
FIND_LIBRARY(UUID_LIBRARY NAMES uuid
             PATHS /usr/local/lib )

ADD_LIBRARY(uuidx SHARED ${LIBUUIDX_SRC})
SET_TARGET_PROPERTIES(uuidx PROPERTIES VERSION 1.0 SOVERSION 1)

TARGET_LINK_LIBRARIES(uuidx ${UUID_LIBRARY})

#INSTALL(TARGETS syncr LIBRARY DESTINATION lib)
INSTALL(TARGETS uuidx LIBRARY DESTINATION /usr/local/openresty/lualib)
INSTALL(FILES uuid.lua DESTINATION /usr/local/openresty/lualib/resty)
